// Copyright (c) 2007-2008, 
// Trevor McCauley, http://www.senocular.com, 
// Alessandro Crugnola, http://www.sephiroth.it,
// Marc Speck, http://www.faindu.com
// All Rights Reserved. The following is Source Code and is subject to all restrictions 
// on such code as contained in the license accompanying this product.
package com.faindu.editImage.outline
{
import com.faindu.editImage.base.BaseControl;

import flash.events.Event;
import flash.geom.Point;

/**
* Outline draws the rectangle around the target. 
*/
public class OutlineControl extends BaseControl
{
	function OutlineControl(): void
	{
		super( null, "outline")
	}
	/**
	 * @inheritDoc
	 */
	override public function draw(event:Event = null):void 
	{
		var topLeft:Point =		editImage.controlsPositions.topLeft
		var topRight:Point = 	editImage.controlsPositions.topRight
		var bottomRight:Point =	editImage.controlsPositions.bottomRight
		var bottomLeft:Point =	editImage.controlsPositions.bottomLeft

		graphics.clear()
		graphics.lineStyle( 2, 0x000000, 1 )
		graphics.moveTo( topLeft.x, topLeft.y)
		graphics.lineTo( topRight.x, topRight.y)
		graphics.lineTo( bottomRight.x, bottomRight.y)
		graphics.lineTo( bottomLeft.x, bottomLeft.y)
		graphics.lineTo( topLeft.x, topLeft.y)
	}
}
}